package a.f.b;

import a.c.ab;
import a.c.bb;
import a.c.*;
import a.c.x;
import a.d.t;
import a.d.u;
import a.f.cb;
import a.f.*;
import a.f.d.a.fc;
import a.f.d.a.sc;
import a.f.o;
import a.f.r;
import a.i.y;

import java.util.*;

import a.d.u;
import a.d.t;
import a.i.y;

public class a
  extends mb
{
  public static final String w = "y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE";
  public static final String x = "FAMILY";
  public static final String y = "MALE";
  public static final String z = "FEMALE";
  public static final int A = -1;
  public static final int B = 0;
  public static final int C = 1;
  private n D;
  private n E;
  private n F;
  private n G;
  private x H;
  private x I;
  private x J;
  private x K;
  private x L;
  private x M;
  private x N;
  private rc O;
  private boolean P = true;
  private double Q = 30.0D;
  private double R = 10.0D;
  private boolean S = true;
  private boolean T = false;
  private int U = 0;
  public static final int V = 0;
  public static final int W = 1;
  public static final int X = 2;
  public static final int Y = 3;
  public static final int Z = 4;
  private int ab = 0;
  private sc bb = null;
  private boolean[] cb;
  private ArrayList db;
  private bb eb;
  public static int fb;
  public static boolean gb;
  
  public a()
  {
    d(false);
    ((cb)h()).a(12);
    this.O = null;
    if (!bool)
    {
      if (q.n) {
        i++;
      }
    }
    else {
      fb = i;
    }
    if (q.o) {
      gb = !bool;
    }
  }
  
  public rc a()
  {
    boolean bool = gb;
    int i = fb;
    if (!bool) {
      if (this.O == null)
      {
        a.f.d.e locale = new a.f.d.e();
        a.f.d.a.z localz = locale.U();
        localz.c(true);
        localz.a(60.0D);
        localz.b(20.0D);
        fc localfc = locale.W();
        if (!bool) {
          switch (this.U)
          {
          case -1: 
            localfc.b(0.0D);
            if (!bool) {
              if (i == 0) {
                break label133;
              }
            }
          case 0: 
            if (!bool)
            {
              localfc.b(0.5D);
              if (i == 0) {
                break label133;
              }
            }
          case 1: 
            localfc.b(1.0D);
          }
        }
        label133:
        this.O = locale;
      }
    }
    return this.O;
  }
  
  private boolean s()
  {
    boolean bool = gb;
    if (!bool) {
      if (this.P)
      {
        if (bool) {
          break label32;
        }
        if (this.ab == 0) {
          break label28;
        }
      }
    }
    return false;
    label28:
    label32:
    rc localrc = a();
    if (!bool) {
      if ((localrc instanceof vc)) {
        localrc = ((vc)localrc).a();
      }
    }
    return localrc instanceof a.f.d.e;
  }
  
  public void a(rc paramrc)
  {
    this.O = paramrc;
  }
  
  public void a(double paramDouble)
  {
    this.Q = paramDouble;
  }
  
  public double t()
  {
    return this.Q;
  }
  
  public void b(double paramDouble)
  {
    this.R = paramDouble;
  }
  
  public double u()
  {
    return this.R;
  }
  
  public void h(boolean paramBoolean)
  {
    this.S = paramBoolean;
  }
  
  public boolean v()
  {
    return this.S;
  }
  
  public void i(boolean paramBoolean)
  {
    this.T = paramBoolean;
  }
  
  public boolean w()
  {
    return this.T;
  }
  
  public int x()
  {
    return this.U;
  }
  
  public void a(int paramInt)
  {
    boolean bool = gb;
    int i = fb;
    double d = 0.0D;
    if (!bool) {}
    switch (paramInt)
    {
    case 1: 
      d = 1.0D;
      if (!bool) {
        if (i == 0) {
          break label87;
        }
      }
    case 0: 
      d = 0.5D;
      if (!bool) {
        if (i == 0) {
          break label87;
        }
      }
    case -1: 
      d = 0.0D;
      if (i == 0) {
        break label87;
      }
    }
    throw new IllegalArgumentException("Unknown alignment.");
    label87:
    if (!bool) {
      if (this.O != null)
      {
        if (bool) {
          break label129;
        }
        if ((this.O instanceof a.f.d.e)) {
          ((a.f.d.e)this.O).W().b(d);
        }
      }
    }
    label129:
    this.U = paramInt;
  }
  
  public boolean b(o paramo)
  {
    boolean bool = gb;
    int i = fb;
    k localk = paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
    if (localk == null) {
      return false;
    }
    a.c.w localw1 = paramo.v();
    label153:
    label196:
    label204:
    do
    {
      do
      {
        if (!localw1.e()) {
          break;
        }
        break label153;
        a.c.e locale = localw1.d();
        a.c.w localw2 = locale.p();
        if (i != 0) {
          break label213;
        }
        if ("FAMILY".equals(localk.get(locale)))
        {
          if (!bool) {
            if (localw2.k() > 2) {
              return false;
            }
          }
          do
          {
            if (!localw2.e()) {
              break label196;
            }
            if (i != 0) {
              break;
            }
            if ("FAMILY".equals(localk.get(localw2.d()))) {
              return false;
            }
            localw2.f();
          } while (i == 0);
        }
        do
        {
          if (bool) {
            break label204;
          }
          if (!localw2.e()) {
            break label196;
          }
          if (i != 0) {
            break;
          }
          if (!"FAMILY".equals(localk.get(localw2.d()))) {
            return false;
          }
          localw2.f();
        } while (i == 0);
        localw1.f();
      } while (bool);
    } while (i == 0);
    label213:
    return true;
  }
  
  public int y()
  {
    return this.ab;
  }
  
  public void b(int paramInt)
  {
    this.ab = paramInt;
  }
  
  private void e(o paramo)
  {
    boolean bool = gb;
    int i = fb;
    this.M = db.a();
    k localk = paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
    if (localk != null)
    {
      a.c.w localw = paramo.v();
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        if (!bool)
        {
          if ("FAMILY".equals(localk.get(locale))) {
            this.M.a(locale, locale.e());
          }
          localw.f();
        }
      } while (i == 0);
    }
  }
  
  private void f(o paramo)
  {
    boolean bool = gb;
    int i = fb;
    this.N = db.a();
    k localk = paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
    if (localk != null)
    {
      a.c.w localw = paramo.v();
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        if (!bool)
        {
          if ("FAMILY".equals(localk.get(locale))) {
            this.N.a(locale, locale.d());
          }
          localw.f();
        }
      } while (i == 0);
    }
  }
  
  protected void a(o paramo)
  {
    boolean bool = gb;
    int i4 = fb;
    if (paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE") == null) {
      throw new IllegalStateException("DataProvider y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE is not registered to the graph.");
    }
    y localy1 = new y(paramo);
    k localk1 = paramo.c(i.c);
    k localk2 = paramo.c(i.b);
    k localk3 = paramo.c(i.a);
    k localk4 = paramo.c(i.d);
    y localy2 = new y(paramo);
    n localn = null;
    x localx1 = db.a();
    x localx2 = db.a();
    x localx3 = db.a();
    x localx4 = db.a();
    j localj = db.c();
    bb localbb = null;
    e(paramo);
    f(paramo);
    if (localk1 != null)
    {
      localn = paramo.C();
      int i = 0;
      localObject1 = paramo.w();
      do
      {
        if (!((m)localObject1).e()) {
          break;
        }
        localObject2 = ((m)localObject1).a();
        if ((!bool) && (i4 != 0)) {
          break label275;
        }
        if (localk1.getBool(((d)localObject2).e()) != localk1.getBool(((d)localObject2).f()))
        {
          localn.a(localObject2, true);
          localy2.a((d)localObject2);
          i = 1;
          if (bool) {
            continue;
          }
          if (i4 != 0)
          {
            if (!bool) {}
            q.n = !q.n;
          }
        }
        else
        {
          localn.a(localObject2, false);
        }
        ((m)localObject1).f();
      } while (i4 == 0);
      if ((!bool) && (i == 0))
      {
        label275:
        paramo.a(localn);
        localn = null;
      }
      localObject1 = paramo.v();
      do
      {
        if (!((a.c.w)localObject1).e()) {
          break;
        }
        localObject2 = ((a.c.w)localObject1).d();
        if (i4 != 0) {
          break label439;
        }
        if (!bool)
        {
          if (localk1.getBool(localObject2))
          {
            localj.a(localk3.get(localObject2), localObject2);
            localy1.a((a.c.e)localObject2);
            localx1.a(localObject2, true);
            localx2.a(localObject2, localk2.get(localObject2));
            localx3.a(localObject2, localk3.get(localObject2));
            localx4.a(localObject2, localk4.get(localObject2));
          }
          ((a.c.w)localObject1).f();
        }
      } while (i4 == 0);
      if ((!bool) && (localk1 != null)) {
        label439:
        paramo.j(localk1);
      }
      if (!bool) {
        if (localk2 != null) {
          paramo.j(localk2);
        }
      }
      if (!bool) {
        if (localk3 != null) {
          paramo.j(localk3);
        }
      }
      if (localk4 != null) {
        paramo.j(localk4);
      }
    }
    a_ locala_ = new a_(null);
    a(paramo, locala_);
    label559:
    label699:
    label722:
    label725:
    Object localObject6;
    label1037:
    label1038:
    label1313:
    label1315:
    label1575:
    if (localk1 != null)
    {
      localObject1 = new a.f.c.h(paramo);
      localObject2 = paramo.v();
      label834:
      label970:
      label1126:
      label1397:
      label1399:
      label1402:
      label1407:
      do
      {
        if (!((a.c.w)localObject2).e()) {
          break;
        }
        localObject3 = ((a.c.w)localObject2).d();
        if (i4 != 0) {
          break label1575;
        }
        if (((a.f.c.h)localObject1).e((a.c.e)localObject3))
        {
          localObject4 = new ArrayList();
          localx1.a(localObject3, false);
          Object localObject5 = ((a.f.c.h)localObject1).c((a.c.e)localObject3).iterator();
          Object localObject7;
          do
          {
            Object localObject8;
            do
            {
              do
              {
                if (!((Iterator)localObject5).hasNext()) {
                  break;
                }
                localObject7 = (a.c.e)((Iterator)localObject5).next();
                localObject8 = localk2.get(localObject7);
              } while (localObject8 == null);
              if (bool) {
                break label834;
              }
              if (i4 != 0) {
                break label725;
              }
              int m = 0;
              do
              {
                if (m >= ((ArrayList)localObject4).size()) {
                  break;
                }
                if (i4 != 0) {
                  break label699;
                }
                if (localObject8 == localk2.get(((ArrayList)localObject4).get(m)))
                {
                  localObject8 = null;
                  break;
                }
                m++;
              } while (i4 == 0);
            } while ((bool) || (localObject8 == null));
            if (bool) {
              break label722;
            }
            ((ArrayList)localObject4).add(localObject7);
          } while (i4 == 0);
          if (((ArrayList)localObject4).size() == 0)
          {
            localObject5 = ((a.f.c.h)localObject1).c((a.c.e)localObject3).m();
            localx2.a(localObject3, localk2.get(localObject5));
            localx3.a(localObject3, localk3.get(localObject5));
          }
          else
          {
            localx2.a(localObject3, localk2.get(((ArrayList)localObject4).get(0)));
            localx3.a(localObject3, localk3.get(((ArrayList)localObject4).get(0)));
            if (bool) {
              continue;
            }
            if (((ArrayList)localObject4).size() > 1)
            {
              int j = 0;
              if (j < ((ArrayList)localObject4).size()) {}
              int k;
              Object localObject9;
              do
              {
                localObject7 = (a.c.e)localj.get(localk2.get(((ArrayList)localObject4).get(j)));
                if (bool) {
                  break label1038;
                }
                if (i4 != 0) {
                  break label1037;
                }
                k = 0;
                do
                {
                  do
                  {
                    if (k >= ((ArrayList)localObject4).size()) {
                      break label970;
                    }
                    localObject9 = (a.c.e)localj.get(localk2.get(((ArrayList)localObject4).get(k)));
                    if (i4 != 0) {
                      break;
                    }
                    if (localk3.get(localObject9).equals(localk2.get(localObject7))) {
                      ((ArrayList)localObject4).remove(k);
                    }
                    k++;
                  } while (i4 == 0);
                  j++;
                } while (bool);
                if (i4 == 0) {
                  break;
                }
                localx2.a(localObject3, localk2.get(((ArrayList)localObject4).get(0)));
                localx3.a(localObject3, localk3.get(((ArrayList)localObject4).get(0)));
              } while (bool);
              if (((ArrayList)localObject4).size() != 1)
              {
                if ((bool) || (localbb == null)) {
                  localbb = new bb();
                }
                localObject6 = paramo.i();
                localObject7 = "ngi" + ((a.c.e)localObject6).f();
                localbb.add(localObject6);
                localx1.a(localObject6, true);
                localx3.a(localObject6, localObject7);
                k = 1;
                if (k < ((ArrayList)localObject4).size()) {}
                do
                {
                  localObject9 = (a.c.e)((ArrayList)localObject4).get(0);
                  if (i4 == 0)
                  {
                    int n = 0;
                    do
                    {
                      if (localObject9 == null) {
                        break label1402;
                      }
                      a.c.e locale1 = (a.c.e)localj.get(localk2.get(localObject9));
                      if (i4 != 0) {
                        break;
                      }
                      Object localObject10 = (a.c.e)((ArrayList)localObject4).get(k);
                      do
                      {
                        if (localObject10 == null) {
                          break label1332;
                        }
                        a.c.e locale2 = (a.c.e)localj.get(localk2.get(localObject10));
                        if (i4 != 0) {
                          break;
                        }
                        if (!bool)
                        {
                          if (locale2 != locale1) {
                            break label1323;
                          }
                          if (bool) {}
                        }
                        else if (((ArrayList)localObject4).get(0) != localObject9)
                        {
                          int i2 = 0;
                          do
                          {
                            if (i2 >= k) {
                              break;
                            }
                            ((ArrayList)localObject4).set(i2, localObject9);
                            i2++;
                            if (bool) {
                              break label1315;
                            }
                            if (i4 != 0) {
                              break label1313;
                            }
                          } while (i4 == 0);
                        }
                        ((ArrayList)localObject4).set(k, localObject10);
                        if (!bool) {
                          n = 1;
                        }
                        if (bool) {
                          break label1339;
                        }
                        if (i4 == 0) {
                          break label1332;
                        }
                        localObject10 = locale2;
                      } while (i4 == 0);
                      if (bool) {
                        break label1407;
                      }
                      if ((!bool) && (n != 0)) {
                        break label1402;
                      }
                      int i1 = 0;
                      if (i1 < k) {}
                      while (bool)
                      {
                        ((ArrayList)localObject4).set(i1, localObject9);
                        i1++;
                        if (bool) {
                          break label1399;
                        }
                        if (i4 != 0) {
                          break label1397;
                        }
                        if (i4 == 0) {
                          break;
                        }
                      }
                      localObject9 = locale1;
                    } while (i4 == 0);
                    k++;
                    if (bool) {
                      break label559;
                    }
                    if (i4 == 0) {
                      break label1126;
                    }
                    if (bool) {
                      break label1423;
                    }
                  }
                  k = 0;
                  do
                  {
                    if (k >= ((ArrayList)localObject4).size()) {
                      break;
                    }
                    localx2.a(((ArrayList)localObject4).get(k), localObject7);
                    k++;
                    if (bool) {
                      break label1502;
                    }
                    if (i4 != 0) {
                      break label1500;
                    }
                  } while (i4 == 0);
                  localx2.a(localObject6, localk2.get(((ArrayList)localObject4).get(0)));
                } while (bool);
                localy1.a((a.c.e)localObject6);
                if (bool) {
                  continue;
                }
                if (i4 == 0) {}
              }
            }
          }
        }
        else
        {
          localx1.a(localObject3, false);
          localx2.a(localObject3, localk2.get(localObject3));
          localx3.a(localObject3, localk3.get(localObject3));
        }
        ((a.c.w)localObject2).f();
      } while (i4 == 0);
      label1323:
      label1332:
      label1339:
      label1500:
      label1502:
      if (!bool) {
        ((a.f.c.h)localObject1).e();
      }
    }
    label1423:
    Object localObject1 = new d_(a());
    Object localObject2 = new r((rc)localObject1)
    {
      private final y val$groupHider;
      private final k val$originalGroupDP;
      private final x val$intermediateGroupMap;
      private final x val$intermediateParentIDMap;
      private final x val$intermediateNodeIDMap;
      private final x val$intermediateInsetsMap;
      
      public boolean canLayout(o paramAnonymouso)
      {
        return true;
      }
      
      public void doLayout(o paramAnonymouso)
      {
        bb localbb = new bb(this.val$groupHider.k());
        this.val$groupHider.g();
        if (!a.gb)
        {
          if (this.val$originalGroupDP != null)
          {
            paramAnonymouso.a(i.c, this.val$intermediateGroupMap);
            paramAnonymouso.a(i.b, this.val$intermediateParentIDMap);
            paramAnonymouso.a(i.a, this.val$intermediateNodeIDMap);
            paramAnonymouso.a(i.d, this.val$intermediateInsetsMap);
          }
          a(paramAnonymouso);
        }
        this.val$groupHider.a(localbb);
        paramAnonymouso.j(i.c);
        paramAnonymouso.j(i.b);
        paramAnonymouso.j(i.a);
        paramAnonymouso.j(i.d);
      }
    };
    Object localObject3 = new a.f.z();
    ((a.f.z)localObject3).a((rc)localObject2);
    Object localObject4 = new a.f.c.e((rc)localObject3);
    ((a.f.c.e)localObject4).a(s());
    try
    {
      new e_((rc)localObject4, locala_, (d_)localObject1).doLayout(paramo);
    }
    finally
    {
      localy1.g();
      paramo.j(i.c);
      paramo.j(i.b);
      paramo.j(i.a);
      paramo.j(i.d);
      if (localbb != null)
      {
        int i3 = 0;
        if (i3 < localbb.size())
        {
          paramo.a((a.c.e)localbb.get(i3));
          i3++;
        }
        for (;;)
        {
          if ((bool) || (i4 == 0))
          {
            if (i4 == 0) {
              break;
            }
            if (!bool) {
              localbb = null;
            }
          }
        }
      }
      if (!bool) {
        if (localk1 != null) {
          paramo.a(i.c, localk1);
        }
      }
      if (!bool) {
        if (localk2 != null) {
          paramo.a(i.b, localk2);
        }
      }
      if (!bool) {
        if (localk3 != null) {
          paramo.a(i.a, localk3);
        }
      }
      if (localk4 != null) {
        paramo.a(i.d, localk4);
      }
      localy2.g();
      g(paramo);
    }
    if (localn != null)
    {
      paramo.a(c.g, localn);
      localObject6 = new a.f.l.h();
      ((a.f.l.h)localObject6).a(c.g);
      try
      {
        ((a.f.l.h)localObject6).doLayout(paramo);
      }
      finally
      {
        paramo.j(c.g);
        paramo.a(localn);
      }
    }
    if (bool) {
      q.o = !q.o;
    }
  }
  
  private void a(o paramo, rc paramrc)
  {
    boolean bool = gb;
    int i = fb;
    k localk = paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
    this.D = paramo.C();
    this.E = paramo.C();
    this.F = paramo.C();
    this.G = paramo.C();
    if (!bool) {
      if ((this.O instanceof a.f.d.e))
      {
        if (bool) {
          break label92;
        }
        if (this.ab != 0) {
          this.bb = ((a.f.d.e)this.O).f(paramo);
        }
      }
    }
    label92:
    c(paramo, paramrc);
    a.c.w localw = paramo.v();
    label367:
    do
    {
      do
      {
        if (!localw.e()) {
          break label625;
        }
        a.c.e locale;
        Object localObject2;
        Object localObject3;
        do
        {
          locale = localw.d();
          if (i != 0) {
            return;
          }
          if (!"FAMILY".equals(paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(locale))) {
            break;
          }
          Object localObject1 = null;
          localObject2 = locale.n();
          do
          {
            if (!((m)localObject2).e()) {
              break label435;
            }
            localObject3 = ((m)localObject2).a().f();
            if (i != 0) {
              break;
            }
            if (localObject1 == null) {
              localObject1 = localObject3;
            }
            paramo.a(((m)localObject2).a(), new a.d.w(0.0D, paramo.d(((m)localObject2).a().e()).d() / 2.0D));
            paramo.b(((m)localObject2).a(), new a.d.w(0.0D, -paramo.d(((m)localObject2).a().f()).d() / 2.0D));
            this.F.a(((m)localObject2).a(), cd.a((byte)2, true));
            this.G.a(((m)localObject2).a(), cd.a((byte)1, true));
            if (!bool)
            {
              if ((this.bb != null) && (localObject1 != localObject3))
              {
                if (!bool) {
                  if (this.ab != 4) {
                    if (bool) {
                      break label367;
                    }
                  }
                }
                if ((this.ab == 3) != "MALE".equals(localk.get(localObject3)))
                {
                  this.bb.b(localObject1, localObject3);
                  if (bool) {
                    continue;
                  }
                  if (i == 0) {}
                }
                else
                {
                  this.bb.a(localObject1, localObject3);
                }
              }
              ((m)localObject2).f();
            }
          } while (i == 0);
          localObject2 = new ArrayList();
          localObject3 = "CG" + locale.f();
        } while (bool);
        m localm = locale.n();
        do
        {
          if (!localm.e()) {
            break;
          }
          d locald = localm.a();
          this.D.a(locald, localObject3);
          Object localObject4 = this.J.get(locald.f());
          if (bool) {
            break label622;
          }
          if (i != 0) {
            break label620;
          }
          if (!bool)
          {
            if (localObject4 != null)
            {
              if (bool) {
                continue;
              }
              if (((ArrayList)localObject2).indexOf(localObject4) != -1) {}
            }
            else
            {
              this.E.a(locald, localObject3);
              if (bool) {
                continue;
              }
            }
          }
          else if (localObject4 != null) {
            ((ArrayList)localObject2).add(localObject4);
          }
          localm.f();
        } while (i == 0);
      } while (bool);
      localw.f();
    } while (i == 0);
    label435:
    label620:
    label622:
    label625:
    paramo.a(ed.c, this.D);
    paramo.a(ed.d, this.E);
    paramo.a(ed.a, this.F);
    if (!bool) {
      paramo.a(ed.b, this.G);
    }
  }
  
  private void c(o paramo, rc paramrc)
  {
    boolean bool = gb;
    int m = fb;
    this.cb = new boolean[paramo.k()];
    this.db = new ArrayList();
    ArrayList localArrayList = new ArrayList();
    this.eb = new bb();
    this.I = paramo.B();
    this.J = paramo.B();
    this.K = paramo.B();
    this.H = paramo.B();
    this.L = paramo.B();
    a.c.w localw = paramo.v();
    Object localObject1;
    a.c.e locale;
    label207:
    label210:
    Object localObject2;
    int j;
    Object localObject3;
    label361:
    label370:
    do
    {
      if (!localw.e()) {
        break;
      }
      localObject1 = new bb();
      locale = localw.d();
      this.I.a(locale, "n" + locale.f());
      if (m != 0) {
        break label397;
      }
      if ("FAMILY".equals(paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(locale)))
      {
        if (bool) {
          break label207;
        }
        a(locale, (bb)localObject1);
        if (m == 0) {
          break label210;
        }
      }
      c(locale, (bb)localObject1);
      localObject2 = new ArrayList();
      ((ArrayList)localObject2).add(localObject1);
      a((bb)localObject1, (ArrayList)localObject2);
      j = 0;
      do
      {
        do
        {
          if (j >= ((ArrayList)localObject2).size()) {
            break;
          }
          while (m != 0) {
            localObject1 = (bb)((ArrayList)localObject2).get(j);
          }
          if (((bb)localObject1).size() > 1)
          {
            localObject3 = new StringBuffer("GN");
            int k = 0;
            do
            {
              do
              {
                if (k >= ((bb)localObject1).size()) {
                  break;
                }
                ((StringBuffer)localObject3).append(String.valueOf(((a.c.e)((bb)localObject1).get(k)).f()));
                ((StringBuffer)localObject3).append('/');
                k++;
                if (bool) {
                  break label370;
                }
                if (m != 0) {
                  break label361;
                }
              } while (m == 0);
            } while (bool);
            localArrayList.add(((StringBuffer)localObject3).toString());
            this.db.add(localObject1);
          }
          j++;
        } while (m == 0);
        localw.f();
      } while (bool);
    } while (m == 0);
    label397:
    int i = 0;
    label599:
    label601:
    do
    {
      if (i >= this.db.size()) {
        break;
      }
      localObject1 = new u(0.0D, 0.0D, 0.0D, 0.0D);
      locale = paramo.i();
      localObject2 = (bb)this.db.get(i);
      this.eb.add(locale);
      if ((!bool) && (m != 0)) {
        return;
      }
      j = 0;
      do
      {
        if (j >= ((bb)localObject2).size()) {
          break;
        }
        localObject3 = (a.c.e)((bb)localObject2).get(j);
        this.J.a(localObject3, localArrayList.get(i));
        this.H.a(localObject3, paramrc);
        this.L.a(localObject3, localObject1);
        j++;
        if (bool) {
          break label601;
        }
        if (m != 0) {
          break label599;
        }
      } while (m == 0);
      this.L.a(locale, localObject1);
      this.K.a(locale, true);
      this.I.a(locale, localArrayList.get(i));
      if (!bool) {
        i++;
      }
    } while (m == 0);
    paramo.a(i.a, this.I);
    paramo.a(i.b, this.J);
    paramo.a(i.c, this.K);
    paramo.a(i.d, this.L);
    if (!bool) {
      paramo.a(a.f.z.g, this.H);
    }
  }
  
  private void a(a.c.e parame, bb parambb)
  {
    boolean bool = gb;
    int j = fb;
    int i;
    a.c.w localw;
    if ((bool) || ("FAMILY".equals(parame.g().c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(parame))))
    {
      if (!bool)
      {
        if (this.cb[parame.f()] == 0)
        {
          parambb.add(parame);
          this.cb[parame.f()] = true;
        }
      }
      else
      {
        i = 0;
        localw = parame.p();
      }
    }
    else {
      while (localw.e())
      {
        c(localw.d(), parambb);
        i++;
        if (!bool)
        {
          if (i > 2) {
            throw new a.c.a("Family node has more than two parent nodes");
          }
          localw.f();
        }
        if (j != 0) {
          throw new a.c.a("Direct link between two individuals");
        }
      }
    }
  }
  
  private void c(a.c.e parame, bb parambb)
  {
    boolean bool = gb;
    int i = fb;
    a.c.w localw;
    if ((bool) || (!"FAMILY".equals(parame.g().c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(parame))))
    {
      if ((bool) || (this.cb[parame.f()] == 0))
      {
        parambb.add(parame);
        this.cb[parame.f()] = true;
        localw = parame.q();
      }
    }
    else {
      while (localw.e())
      {
        a(localw.d(), parambb);
        localw.f();
        if (i != 0) {
          throw new a.c.a("Direct link between two family nodes");
        }
      }
    }
  }
  
  private void a(bb parambb, ArrayList paramArrayList)
  {
    boolean bool = gb;
    int k = fb;
    int i = -1;
    int j = -1;
    i = 0;
    label134:
    do
    {
      if (i >= parambb.size()) {
        break;
      }
      localObject1 = (a.c.e)parambb.get(i);
      if (bool) {
        break label156;
      }
      if (k != 0) {
        break label155;
      }
      if ("FAMILY".equals(((a.c.e)localObject1).g().c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(localObject1)))
      {
        localObject2 = ((a.c.e)localObject1).q();
        do
        {
          do
          {
            if (!((a.c.w)localObject2).e()) {
              break;
            }
            j = parambb.indexOf(((a.c.w)localObject2).d());
            if (k != 0) {
              break label134;
            }
            if (j > -1) {
              break;
            }
            ((a.c.w)localObject2).f();
          } while (k == 0);
        } while (bool);
        if (j > -1) {
          break;
        }
      }
      i++;
    } while (k == 0);
    label155:
    if ((!bool) && (j == -1)) {
      label156:
      return;
    }
    Object localObject1 = new bb();
    Object localObject2 = (a.c.e)parambb.get(i);
    a.c.e locale1 = (a.c.e)parambb.get(j);
    bb localbb = new bb();
    parambb.remove(locale1);
    ((bb)localObject1).add(locale1);
    a.c.w localw = locale1.q();
    a.c.e locale2;
    Object localObject3;
    Object localObject4;
    label345:
    do
    {
      if (!localw.e()) {
        break;
      }
      locale2 = localw.d();
      parambb.remove(locale2);
      ((bb)localObject1).add(locale2);
      if (k != 0) {
        break label384;
      }
      localObject3 = locale2.p();
      do
      {
        do
        {
          if (!((a.c.w)localObject3).e()) {
            break;
          }
          localObject4 = ((a.c.w)localObject3).d();
          if (k != 0) {
            break label412;
          }
          if (localObject4 != locale1)
          {
            if (!bool) {
              if (a(locale2, (a.c.e)localObject4, (a.c.e)localObject2, locale1))
              {
                a(locale2, parambb, (bb)localObject1);
                if (bool) {
                  continue;
                }
                if (k == 0) {
                  break label345;
                }
              }
            }
            localbb.add(locale2);
          }
          ((a.c.w)localObject3).f();
        } while (k == 0);
        localw.f();
      } while (bool);
    } while (k == 0);
    if (!bool) {
      label384:
      localw = localbb.l();
    }
    label412:
    label424:
    label553:
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        locale2 = localw.d();
        if (k != 0) {
          return;
        }
        do
        {
          break label424;
          localObject3 = locale2.m();
          do
          {
            if (!((m)localObject3).e()) {
              break label553;
            }
            if (k != 0) {
              break;
            }
            if (((m)localObject3).a().e() != locale1)
            {
              localObject4 = (o)locale1.g();
              ((o)localObject4).a(((m)localObject3).a(), new a.d.w(0.0D, 0.0D));
              ((o)localObject4).b(((m)localObject3).a(), new a.d.w(0.0D, 0.0D));
              this.F.a(((m)localObject3).a(), cd.a((byte)0, true));
              this.G.a(((m)localObject3).a(), cd.a((byte)0, true));
            }
            ((m)localObject3).f();
          } while (k == 0);
          localw.f();
        } while (bool);
      } while (k == 0);
      a(parambb, paramArrayList);
      a((bb)localObject1, paramArrayList);
    } while (bool);
    paramArrayList.add(localObject1);
  }
  
  private boolean a(a.c.e parame1, a.c.e parame2, a.c.e parame3, a.c.e parame4)
  {
    return a(parame1, parame2, parame3, parame4, new HashSet());
  }
  
  private boolean a(a.c.e parame1, a.c.e parame2, a.c.e parame3, a.c.e parame4, Set paramSet)
  {
    boolean bool = gb;
    int i = fb;
    if ((bool) || (!paramSet.add(new b_(parame1, parame2)))) {
      return true;
    }
    a.c.w localw1 = parame2.q();
    label167:
    do
    {
      do
      {
        if (!localw1.e()) {
          break;
        }
        a.c.e locale1 = localw1.d();
        if (locale1 != parame1) {
          if (!bool) {
            if (locale1 != parame3) {}
          }
        }
        do
        {
          return false;
          a.c.w localw2 = locale1.p();
          do
          {
            if (!localw2.e()) {
              break label167;
            }
            a.c.e locale2 = localw2.d();
            if (i != 0) {
              break;
            }
            if (locale2 != parame2)
            {
              if (locale2 == parame4) {
                return true;
              }
              if (bool) {
                continue;
              }
              if (!a(locale1, locale2, parame3, parame4, paramSet)) {
                return false;
              }
            }
            localw2.f();
          } while (i == 0);
          localw1.f();
        } while (bool);
      } while (i == 0);
    } while (bool);
    return true;
  }
  
  private void a(a.c.e parame, bb parambb1, bb parambb2)
  {
    boolean bool = gb;
    int i = fb;
    a.c.w localw1 = parame.p();
    label141:
    do
    {
      do
      {
        if (!localw1.e()) {
          break;
        }
        a.c.e locale1 = localw1.d();
        if (!bool)
        {
          if (parambb1.indexOf(locale1) >= 0) {
            parambb1.remove(locale1);
          }
        }
        else
        {
          parambb2.add(locale1);
          a.c.w localw2 = locale1.q();
          do
          {
            if (!localw2.e()) {
              break label141;
            }
            a.c.e locale2 = localw2.d();
            if (i != 0) {
              break;
            }
            if (parambb1.indexOf(locale2) > -1)
            {
              parambb1.remove(locale2);
              parambb2.add(locale2);
              a(locale2, parambb1, parambb2);
            }
            localw2.f();
          } while (i == 0);
        }
        localw1.f();
      } while (bool);
    } while (i == 0);
  }
  
  private void g(o paramo)
  {
    boolean bool = gb;
    int j = fb;
    if (!bool) {
      if (this.D != null)
      {
        paramo.j(ed.c);
        paramo.a(this.D);
        this.D = null;
      }
    }
    if (!bool) {
      if (this.E != null)
      {
        paramo.j(ed.d);
        paramo.a(this.E);
        this.E = null;
      }
    }
    if (!bool)
    {
      if (this.F != null)
      {
        paramo.j(ed.a);
        paramo.a(this.F);
        this.F = null;
      }
      if (bool) {}
    }
    else if (this.G != null)
    {
      paramo.j(ed.b);
      paramo.a(this.G);
      this.G = null;
    }
    if (!bool) {
      if (this.L != null)
      {
        paramo.j(i.d);
        paramo.a(this.L);
        this.L = null;
      }
    }
    if (!bool) {
      if (this.H != null)
      {
        paramo.j(a.f.z.g);
        paramo.a(this.H);
        this.H = null;
      }
    }
    if (!bool) {
      if (this.I != null)
      {
        paramo.j(i.a);
        paramo.a(this.I);
        this.I = null;
      }
    }
    if (!bool)
    {
      if (this.J != null)
      {
        paramo.j(i.b);
        paramo.a(this.J);
        this.J = null;
      }
      if (bool) {}
    }
    else if (this.K != null)
    {
      paramo.j(i.c);
      paramo.a(this.K);
      this.K = null;
    }
    if (!bool)
    {
      if (this.db != null)
      {
        int i = 0;
        do
        {
          if (i >= this.db.size()) {
            break;
          }
          paramo.a((a.c.e)this.eb.get(i));
          i++;
          if ((!bool) && (j != 0)) {
            return;
          }
        } while (j == 0);
      }
      if (bool) {}
    }
    else if ((bool) || (this.bb != null))
    {
      this.bb.b();
      this.bb = null;
    }
  }
  
  private class a_
    implements rc
  {
    private boolean e = false;
    private b_ f = new b_(this.g, a.this.M);
    private x g = db.a();
    
    private a_() {}
    
    public boolean a()
    {
      return this.e;
    }
    
    public void a(boolean paramBoolean)
    {
      this.e = paramBoolean;
    }
    
    public boolean canLayout(o paramo)
    {
      return true;
    }
    
    public void doLayout(o paramo)
    {
      boolean bool = a.gb;
      int i14 = a.fb;
      if (!bool) {
        if (paramo.k() == 1) {
          return;
        }
      }
      label178:
      label187:
      Object localObject5;
      Object localObject7;
      if ((bool) || (paramo.k() == 2)) {
        if (((bool) || (a.this.S)) && ((bool) || ((a.this.N.getInt(paramo.p()) < 2) && (a.this.N.getInt(paramo.r()) < 2))))
        {
          localObject1 = null;
          localObject2 = null;
          localObject3 = paramo.v();
          if (((a.c.w)localObject3).e()) {}
          while (bool)
          {
            localObject4 = ((a.c.w)localObject3).d();
            if ((!bool) && (i14 != 0)) {
              break label452;
            }
            if (!bool)
            {
              if (!"FAMILY".equals(paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(localObject4))) {
                localObject1 = localObject4;
              }
            }
            else
            {
              if (bool) {
                break label187;
              }
              if (i14 == 0) {
                break label178;
              }
            }
            localObject2 = localObject4;
            ((a.c.w)localObject3).f();
            if (i14 == 0) {
              break;
            }
          }
          if ((bool) || ((localObject1 != null) && (localObject2 != null)))
          {
            localObject3 = paramo.d(localObject1);
            localObject4 = paramo.d(localObject2);
            ((zc)localObject3).a(-((zc)localObject3).c() / 2.0D, 0.0D);
            ((zc)localObject4).a(-((zc)localObject4).c() / 2.0D, ((zc)localObject3).d() + a.this.R);
            localObject5 = ((a.c.e)localObject2).m();
            do
            {
              if (!((m)localObject5).e()) {
                break;
              }
              localObject6 = ((m)localObject5).a();
              localObject7 = paramo.e(localObject6);
              ((zb)localObject7).b();
              ((zb)localObject7).a(new a.d.w(0.0D, 0.0D));
              ((zb)localObject7).b(new a.d.w(0.0D, 0.0D));
              if (!bool)
              {
                if (i14 != 0) {
                  break label388;
                }
                ((m)localObject5).f();
              }
            } while (i14 == 0);
            if (!bool) {}
            label388:
            localObject5 = (u)a.this.L.get(localObject1);
            Object localObject6 = new u(((u)localObject5).b, ((u)localObject5).c, -a.this.R - paramo.d(localObject2).d(), ((u)localObject5).e);
            a.this.L.a(localObject1, localObject6);
            return;
          }
        }
      }
      label452:
      Object localObject1 = new bb();
      if (!bool)
      {
        if (this.e)
        {
          ((bb)localObject1).a(paramo.v());
          if (bool) {
            break label737;
          }
          ((bb)localObject1).a(new c_(paramo));
        }
      }
      else {
        if (i14 == 0) {
          break label730;
        }
      }
      Object localObject2 = new bb();
      Object localObject3 = new bb();
      Object localObject4 = paramo.v();
      label606:
      do
      {
        if (!((a.c.w)localObject4).e()) {
          break;
        }
        localObject5 = ((a.c.w)localObject4).d();
        if ((!bool) && (i14 != 0)) {
          break label747;
        }
        if (!bool) {
          if (!"FAMILY".equals(paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(localObject5)))
          {
            ((bb)localObject2).add(localObject5);
            if (bool) {
              continue;
            }
            if (i14 == 0) {
              break label606;
            }
          }
        }
        ((bb)localObject3).add(localObject5);
        ((a.c.w)localObject4).f();
      } while (i14 == 0);
      localObject4 = null;
      int i = 0;
      if (!bool)
      {
        int j = 0;
        if (j < ((bb)localObject2).size()) {}
        do
        {
          localObject7 = (a.c.e)((bb)localObject2).get(j);
          if (bool) {
            break label720;
          }
          if (i14 != 0) {
            break label719;
          }
          if (((a.c.e)localObject7).q().k() > i)
          {
            i = ((a.c.e)localObject7).q().k();
            localObject4 = localObject7;
          }
          j++;
          if (i14 == 0) {
            break;
          }
          ((bb)localObject2).remove(localObject4);
        } while (bool);
        label719:
        ((bb)localObject1).add(localObject4);
        label720:
        a((bb)localObject2, (bb)localObject3, (bb)localObject1, (a.c.e)localObject4);
        label730:
        label737:
        localObject2 = new bb();
        localObject3 = new bb();
      }
      label747:
      localObject4 = new ArrayList();
      i = 0;
      double d1 = 0.0D;
      double d2 = 1.7976931348623157E+308D;
      int k = 0;
      if (k < ((bb)localObject1).size()) {}
      Object localObject8;
      label1017:
      while (bool)
      {
        localObject8 = (a.c.e)((bb)localObject1).get(k);
        zc localzc1 = paramo.d(localObject8);
        if (i14 != 0) {
          break label1032;
        }
        if ("FAMILY".equals(paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE").get(localObject8)))
        {
          ((bb)localObject2).add(localObject8);
          ((ArrayList)localObject4).add(new Integer(k));
          localzc1.a(i + Math.max((a.this.Q - localzc1.c()) / 2.0D, localzc1.c() / 4.0D), -localzc1.d() / 2.0D);
          i = (int)(i + Math.max(localzc1.c() * 1.5D, a.this.Q));
          if (bool) {
            break label1017;
          }
          if (i14 == 0) {}
        }
        else
        {
          ((bb)localObject3).add(localObject8);
          d2 = Math.min(localzc1.d(), d2);
          d1 = Math.max(localzc1.d(), d1);
          localzc1.a(i, -localzc1.d() / 2.0D);
          i = (int)(i + localzc1.c());
        }
        k++;
        if (i14 == 0) {
          break;
        }
      }
      if (a.this.U != 0)
      {
        label1032:
        k = 0;
        do
        {
          if (k >= ((bb)localObject3).size()) {
            break;
          }
          localObject8 = paramo.d(((bb)localObject3).get(k));
          if ((!bool) && (i14 != 0)) {
            break label1154;
          }
          if (a.this.U == 1)
          {
            ((zc)localObject8).a(((zc)localObject8).a(), -(((zc)localObject8).d() - d2 / 2.0D));
            if (bool) {
              continue;
            }
            if (i14 == 0) {}
          }
          else
          {
            ((zc)localObject8).a(((zc)localObject8).a(), -d2 / 2.0D);
          }
          k++;
        } while (i14 == 0);
      }
      label1154:
      int[] arrayOfInt1 = new int[((bb)localObject1).size()];
      int m = -2;
      int n = 0;
      label1258:
      Object localObject10;
      label1334:
      label1341:
      Object localObject11;
      label1539:
      label1541:
      label1548:
      do
      {
        if (n >= ((bb)localObject2).size()) {
          break;
        }
        a.c.e locale = (a.c.e)((bb)localObject2).get(n);
        int i1 = 0;
        int i2 = ((Integer)((ArrayList)localObject4).get(n)).intValue();
        do
        {
          if (!bool) {
            if (!a.this.T)
            {
              if ((!bool) && (m != i2 - 1)) {
                break label1258;
              }
              if (!bool) {
                if (arrayOfInt1[m] != 0) {
                  break label1258;
                }
              }
            }
            else
            {
              i1 = 1;
            }
          }
          if (bool) {
            break label1341;
          }
          if (i14 != 0)
          {
            localObject9 = locale.p();
            do
            {
              if (!((a.c.w)localObject9).e()) {
                break label1334;
              }
              localObject10 = ((a.c.w)localObject9).d();
              int i4 = ((bb)localObject1).indexOf(localObject10) - i2;
              if (i14 != 0) {
                break;
              }
              if (Math.abs(i4) > 2)
              {
                i1 = 1;
                if (bool) {
                  break label1341;
                }
                if (i14 == 0) {
                  break label1334;
                }
              }
              ((a.c.w)localObject9).f();
            } while (i14 == 0);
          }
        } while (bool);
        if (!bool)
        {
          if (i1 != 0) {
            arrayOfInt1[i2] = 1;
          }
        }
        else {
          if (i14 == 0) {
            break label1539;
          }
        }
        Object localObject9 = new a.d.w(0.0D, 0.0D);
        localObject10 = locale.m();
        do
        {
          if (!((m)localObject10).e()) {
            break;
          }
          d locald1 = ((m)localObject10).a();
          zb localzb1 = paramo.e(locald1);
          localzb1.b();
          if (bool) {
            break label1548;
          }
          if (i14 != 0) {
            break label1541;
          }
          if (a.this.U == 0)
          {
            localzb1.a((a.d.w)localObject9);
            if (bool) {
              continue;
            }
            if (i14 == 0) {}
          }
          else
          {
            localObject11 = paramo.d(locald1.e());
            paramo.c(locald1, new a.d.w(((zc)localObject11).a() + ((zc)localObject11).c() / 2.0D, 0.0D));
          }
          localzb1.b((a.d.w)localObject9);
          ((m)localObject10).f();
        } while (i14 == 0);
        ((bb)localObject2).remove(n);
        ((ArrayList)localObject4).remove(n);
        if (!bool)
        {
          n--;
          m = i2;
          n++;
        }
      } while (i14 == 0);
      double d3 = d1 / 2.0D;
      if (!bool) {
        if (a.this.U == 1)
        {
          if (bool) {
            break label1617;
          }
          d3 = d2 / 2.0D;
        }
      }
      if ((i14 != 0) && (a.this.U == -1)) {
        d3 = d1 - d2 / 2.0D;
      }
      label1617:
      double d4 = d3;
      int i3 = 0;
      int i5;
      int i6;
      int i9;
      label1781:
      label1783:
      label1786:
      do
      {
        do
        {
          if (i3 >= ((bb)localObject2).size()) {
            break;
          }
          localObject10 = (a.c.e)((bb)localObject2).get(i3);
          i5 = ((Integer)((ArrayList)localObject4).get(i3)).intValue();
          i6 = 0;
          if (i14 != 0) {
            break label2409;
          }
          localObject11 = ((a.c.e)localObject10).p();
          do
          {
            do
            {
              if (!((a.c.w)localObject11).e()) {
                break label1786;
              }
              int i7 = ((bb)localObject1).indexOf(((a.c.w)localObject11).d());
              int i8 = Math.min(i5, i7);
              i9 = Math.max(i5, i7);
              int i10 = 0;
              if (i14 != 0) {
                break;
              }
              int i11 = i8;
              do
              {
                if (i11 > i9) {
                  break;
                }
                i10 += arrayOfInt1[i11];
                i11++;
                if (bool) {
                  break label1783;
                }
                if (i14 != 0) {
                  break label1781;
                }
              } while (i14 == 0);
              i6 = Math.max(i10, i6);
            } while (bool);
            ((a.c.w)localObject11).f();
          } while (i14 == 0);
          localObject11 = paramo.d(localObject10);
          double d7 = d3 + a.this.R + (((zc)localObject11).d() + a.this.R) * (i6 - 1);
          ((zc)localObject11).a(((zc)localObject11).a(), d7);
          d4 = Math.max(d4, d7 + ((zc)localObject11).d());
          i3++;
        } while (bool);
      } while (i14 == 0);
      i3 = 0;
      if (i3 < ((bb)localObject3).size()) {}
      label2004:
      while (bool)
      {
        localObject10 = (a.c.e)((bb)localObject3).get(i3);
        i5 = ((bb)localObject1).indexOf(localObject10);
        i6 = 0;
        localObject11 = new ab();
        if (i14 != 0) {
          break label2409;
        }
        Object localObject12 = ((a.c.e)localObject10).n();
        do
        {
          if (!((m)localObject12).e()) {
            break;
          }
          d locald2 = ((m)localObject12).a();
          i9 = ((bb)localObject1).indexOf(locald2.f());
          if (i14 != 0) {
            break label2004;
          }
          if (arrayOfInt1[i9] > 0)
          {
            ((ab)localObject11).add(locald2);
            i6++;
          }
          ((m)localObject12).f();
        } while (i14 == 0);
        if (!bool)
        {
          if (i6 > 0)
          {
            localObject12 = paramo.d(localObject10);
            double d8 = ((zc)localObject12).c() / (i6 + 1);
            int[] arrayOfInt2 = new int[((ab)localObject11).size()];
            double[] arrayOfDouble = new double[((ab)localObject11).size()];
            int i12 = 0;
            if (i12 < ((ab)localObject11).size()) {
              arrayOfInt2[i12] = (((bb)localObject1).indexOf(((d)((ab)localObject11).get(i12)).f()) - i5);
            }
            while (bool)
            {
              if (i14 != 0) {
                break label2205;
              }
              if (arrayOfInt2[i12] > 0) {
                arrayOfInt2[i12] -= ((bb)localObject1).size() * 2;
              }
              arrayOfDouble[i12] = d8;
              int i13 = 0;
              do
              {
                do
                {
                  if (i13 >= i12) {
                    break label2186;
                  }
                  if (i14 != 0) {
                    break;
                  }
                  if (arrayOfInt2[i12] > arrayOfInt2[i13])
                  {
                    arrayOfDouble[i13] += d8;
                    if (bool) {
                      continue;
                    }
                    if (i14 == 0) {}
                  }
                  else
                  {
                    arrayOfDouble[i12] += d8;
                  }
                  i13++;
                } while (i14 == 0);
                i12++;
              } while (bool);
              if (i14 == 0) {
                break;
              }
            }
            i12 = 0;
            do
            {
              if (i12 >= ((ab)localObject11).size()) {
                break;
              }
              d locald3 = (d)((ab)localObject11).get(i12);
              zb localzb2 = paramo.e(locald3);
              localzb2.b();
              localzb2.b(new a.d.w(0.0D, 0.0D));
              double d9 = arrayOfDouble[i12];
              zc localzc2 = paramo.d(locald3.f());
              double d10 = localzc2.b() + localzc2.d() / 2.0D;
              zc localzc3 = paramo.d(localObject10);
              localzb2.a(new a.d.w(d9 - localzc3.c() / 2.0D, 0.0D));
              localzb2.a(localzc3.a() + d9, d10);
              i12++;
              if (bool) {
                break label2383;
              }
              if (i14 != 0) {
                break label2381;
              }
            } while (i14 == 0);
          }
          if (bool) {}
        }
        else
        {
          i3++;
        }
        if (i14 == 0) {
          break;
        }
      }
      label2186:
      label2205:
      label2381:
      label2383:
      label2409:
      u localu = (u)a.this.L.get(((bb)localObject3).get(0));
      double d5 = localu.b;
      double d6 = localu.d;
      if (!bool) {
        if (localu != null) {
          if (!bool)
          {
            if (a.this.U != 0) {
              break label2470;
            }
            d5 = d4 - d3;
            if (bool) {
              return;
            }
          }
        }
      }
      label2470:
      if ((i14 != 0) && (localu != null))
      {
        if (bool) {
          break label2502;
        }
        if (a.this.U == 1) {
          d6 = d3 - d4;
        }
      }
      label2502:
      a.this.L.a(((bb)localObject3).get(0), new u(d5, localu.c, d6, localu.e));
    }
    
    private void a(bb parambb1, bb parambb2, bb parambb3, a.c.e parame)
    {
      boolean bool = a.gb;
      int i1 = a.fb;
      bb localbb1 = new bb();
      Object localObject = parame.q();
      do
      {
        if (!((a.c.w)localObject).e()) {
          break;
        }
        a.c.e locale1 = ((a.c.w)localObject).d();
        if (bool) {
          break label135;
        }
        if (i1 != 0) {
          break label128;
        }
        if (!bool)
        {
          if (parambb2.remove(locale1))
          {
            j = a(locale1, parame, new bb(parame));
            this.g.a(locale1, j);
            localbb1.add(locale1);
          }
          ((a.c.w)localObject).f();
        }
      } while (i1 == 0);
      if (!bool) {
        label128:
        localbb1.a(this.f);
      }
      label135:
      localObject = parame.g().c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
      int i = 0;
      if (!bool)
      {
        if (localbb1.size() == 1)
        {
          if (bool) {
            break label200;
          }
          if (parambb3.indexOf(parame) == parambb3.size() - 1) {
            i = 1;
          }
        }
        if (bool) {
          break label220;
        }
      }
      if (a.this.ab != 2)
      {
        label200:
        if (bool) {
          break label319;
        }
        if (a.this.ab != 4) {}
      }
      else
      {
        label220:
        j = 0;
        do
        {
          if (j >= localbb1.size()) {
            break;
          }
          if (!bool) {}
          if ((a.this.ab == 4) == "MALE".equals(((k)localObject).get(parame)))
          {
            parambb3.add(localbb1.get(j));
            if (bool) {
              continue;
            }
            if (i1 == 0) {}
          }
          else
          {
            parambb3.add(0, localbb1.get(j));
          }
          j++;
        } while (i1 == 0);
      }
      label319:
      if (!bool) {
        if (a.this.ab != 0)
        {
          if (bool) {
            break label440;
          }
          if (parambb3.size() == 1)
          {
            if (bool) {
              break label440;
            }
            if (localbb1.size() == 1)
            {
              if (!bool) {}
              if ((a.this.ab == 3) == "MALE".equals(((k)localObject).get(parame)))
              {
                if (bool) {
                  break label541;
                }
                parambb3.add(localbb1.get(0));
                if (i1 == 0) {
                  break label534;
                }
              }
              if (bool) {
                break label541;
              }
              parambb3.add(0, localbb1.get(0));
              if (i1 == 0) {
                break label534;
              }
            }
          }
        }
      }
      label440:
      int j = parambb3.indexOf(parame);
      int k = parambb3.indexOf(parame) + 1;
      int m = 0;
      label523:
      do
      {
        if (m >= localbb1.size()) {
          break;
        }
        if ((bool) || (m % 2 == 0)) {
          if (!bool)
          {
            if (i == 0) {
              parambb3.add(j, localbb1.get(m));
            }
          }
          else
          {
            if (bool) {
              continue;
            }
            if (i1 == 0) {
              break label523;
            }
          }
        }
        parambb3.add(k, localbb1.get(m));
        k++;
        m++;
      } while (i1 == 0);
      label534:
      label541:
      bb localbb2 = new bb();
      k = 0;
      label642:
      label653:
      label729:
      do
      {
        if (k >= localbb1.size()) {
          break;
        }
        m = 0;
        a.c.e locale2 = (a.c.e)localbb1.get(k);
        if (i1 != 0) {
          break label831;
        }
        a.c.e locale3 = null;
        a.c.w localw1 = locale2.p();
        do
        {
          do
          {
            if (!localw1.e()) {
              break label642;
            }
            locale3 = localw1.d();
            if (i1 != 0) {
              break;
            }
            if (locale3 != parame)
            {
              m = 1;
              if (bool) {
                break label653;
              }
              if (i1 == 0) {
                break label642;
              }
            }
            localw1.f();
          } while (i1 == 0);
        } while (bool);
        int n;
        if (!bool) {
          if (parambb1.remove(locale3))
          {
            localbb2.add(locale3);
            n = parambb3.indexOf(locale2);
            if (!bool) {
              if (parambb3.indexOf(parame) > n)
              {
                parambb3.add(parambb3.indexOf(locale2), locale3);
                if (bool) {
                  break label729;
                }
                if (i1 == 0) {
                  break label822;
                }
              }
            }
          }
        }
        do
        {
          parambb3.add(parambb3.indexOf(locale2) + 1, locale3);
          break;
          if ((!bool) && (m == 0)) {
            break;
          }
          n = 0;
          parambb3.remove(locale2);
          a.c.w localw2 = locale2.p();
          do
          {
            if (!localw2.e()) {
              break;
            }
            n = Math.max(parambb3.indexOf(localw2.d()), n);
            localw2.f();
            if (bool) {
              break label827;
            }
            if (i1 != 0) {
              break label825;
            }
          } while (i1 == 0);
        } while (bool);
        parambb3.add(n, locale2);
        k++;
      } while (i1 == 0);
      label822:
      label825:
      label827:
      label831:
      localbb1 = null;
      k = 0;
      do
      {
        while (i1 == 0)
        {
          if (k >= localbb2.size()) {
            break;
          }
          a(parambb1, parambb2, parambb3, (a.c.e)localbb2.get(k));
          k++;
        }
      } while (bool);
    }
    
    private int a(a.c.e parame1, a.c.e parame2, bb parambb)
    {
      boolean bool = a.gb;
      int j = a.fb;
      int i = 1;
      a.c.w localw1 = parame1.p();
      label129:
      label143:
      do
      {
        do
        {
          if (!localw1.e()) {
            break;
          }
          a.c.e locale1 = localw1.d();
          if (locale1 != parame2) {}
          do
          {
            if (bool) {
              break label143;
            }
            if (parambb.indexOf(locale1) == -1)
            {
              parambb.add(locale1);
              a.c.w localw2 = locale1.q();
              do
              {
                if (!localw2.e()) {
                  break label129;
                }
                a.c.e locale2 = localw2.d();
                if (j != 0) {
                  break;
                }
                if (locale2 != parame1) {
                  i += a(locale2, locale1, parambb);
                }
                localw2.f();
              } while (j == 0);
            }
            localw1.f();
          } while (bool);
        } while (j == 0);
      } while (bool);
      return i;
    }
    
    a_(a.2 param2)
    {
      this();
    }
    
    class c_
      implements Comparator
    {
      private o a;
      
      c_(o paramo)
      {
        this.a = paramo;
      }
      
      public int compare(Object paramObject1, Object paramObject2)
      {
        return l.a(this.a.m((a.c.e)paramObject1), this.a.m((a.c.e)paramObject2));
      }
    }
    
    class b_
      implements Comparator
    {
      private k a;
      private k c;
      
      b_(k paramk1, k paramk2)
      {
        this.a = paramk1;
        this.c = paramk2;
      }
      
      public int compare(Object paramObject1, Object paramObject2)
      {
        int i = l.a(this.a.getInt(paramObject1), this.a.getInt(paramObject2));
        if (!a.gb) {
          if (i != 0) {
            return i;
          }
        }
        return l.a(this.c.getInt(paramObject1), this.c.getInt(paramObject2));
      }
    }
  }
  
  private static final class b_
  {
    private final a.c.e a;
    private final a.c.e c;
    
    b_(a.c.e parame1, a.c.e parame2)
    {
      this.a = parame1;
      this.c = parame2;
    }
    
    public boolean equals(Object paramObject)
    {
      boolean bool = a.gb;
      if (!bool) {
        if (this == paramObject) {
          return true;
        }
      }
      if (paramObject != null)
      {
        if (bool) {
          break label37;
        }
        if (getClass() == paramObject.getClass()) {}
      }
      else
      {
        return false;
      }
      label37:
      b_ localb_ = (b_)paramObject;
      if (!bool) {
        if (this.c != localb_.c) {
          return false;
        }
      }
      return this.a == localb_.a;
    }
    
    public int hashCode()
    {
      int i = this.a.hashCode();
      i = 31 * i + this.c.hashCode();
      return i;
    }
  }
  
  class e_
    extends r
  {
    private a.a_ g;
    private a.d_ h;
    
    e_(rc paramrc, a.a_ parama_, a.d_ paramd_)
    {
      super();
      this.g = parama_;
      this.h = paramd_;
    }
    
    public boolean canLayout(o paramo)
    {
      return a().canLayout(paramo);
    }
    
    private boolean a(bb parambb, k paramk)
    {
      boolean bool = a.gb;
      int k = a.fb;
      int i = 0;
      int j = 0;
      a.c.w localw = parambb.l();
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        if (bool) {
          break label120;
        }
        if (k != 0) {
          break label119;
        }
        if ("FAMILY".equals(paramk.get(locale)))
        {
          if (bool) {
            continue;
          }
          if (locale.e() > 0)
          {
            j++;
            if (bool) {
              continue;
            }
            if (k == 0) {}
          }
        }
        else
        {
          i += locale.d();
        }
        localw.f();
      } while (k == 0);
      if (!bool) {
        label119:
        label120:
        if (!bool)
        {
          if (j > 1) {
            break label142;
          }
          if (bool) {
            break label139;
          }
        }
      }
      label139:
      label142:
      return i == 2;
    }
    
    private void a(a.f.c.h paramh, o paramo, x paramx)
    {
      boolean bool = a.gb;
      int i = a.fb;
      k localk = paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
      a.c.w localw1 = a.this.eb.l();
      label201:
      label203:
      label206:
      do
      {
        do
        {
          if (!localw1.e()) {
            return;
          }
          a.c.e locale1 = localw1.d();
          bb localbb = paramh.c(locale1);
          if (bool) {
            break;
          }
          if (a(localbb, localk))
          {
            paramx.a(locale1, true);
            a.c.w localw2 = localbb.l();
            do
            {
              do
              {
                if (!localw2.e()) {
                  break label206;
                }
                a.c.e locale2 = localw2.d();
                if (i != 0) {
                  break;
                }
                if (!"FAMILY".equals(localk.get(locale2)))
                {
                  m localm = locale2.m();
                  do
                  {
                    if (!localm.e()) {
                      break;
                    }
                    a.this.G.a(localm.a(), null);
                    localm.f();
                    if (bool) {
                      break label203;
                    }
                    if (i != 0) {
                      break label201;
                    }
                  } while (i == 0);
                }
              } while (bool);
              localw2.f();
            } while (i == 0);
          }
          localw1.f();
        } while (bool);
      } while (i == 0);
    }
    
    private void a(o paramo, a.f.c.h paramh, k paramk, a.d_ paramd_)
    {
      boolean bool = a.gb;
      int j = a.fb;
      k localk = paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
      a.c.w localw1 = a.this.eb.l();
      label98:
      do
      {
        do
        {
          a.c.e locale1;
          bb localbb;
          Object localObject1;
          Object localObject2;
          do
          {
            if (!localw1.e()) {
              return;
            }
            break label98;
            locale1 = localw1.d();
            if (!paramk.getBool(locale1)) {
              break;
            }
            localbb = paramh.c(locale1);
            localObject1 = null;
            localObject2 = null;
            a.c.w localw2 = localbb.l();
            do
            {
              if (!localw2.e()) {
                break label175;
              }
              a.c.e locale2 = localw2.d();
              if (j != 0) {
                break;
              }
              if (!"FAMILY".equals(localk.get(locale2)))
              {
                if (bool) {
                  continue;
                }
                if (locale2.d() > 0)
                {
                  if (!bool) {
                    if (localObject1 == null)
                    {
                      localObject1 = locale2;
                      if (bool) {
                        continue;
                      }
                      if (j == 0) {
                        break label163;
                      }
                    }
                  }
                  localObject2 = locale2;
                }
              }
              localw2.f();
            } while (j == 0);
          } while (bool);
          if ((bool) || ((localObject1 != null) && (localObject2 != null)))
          {
            double d1 = paramo.m(localObject1);
            double d2 = paramo.m(localObject2);
            double d3 = paramd_.a(localObject1.i()).a;
            double d4 = paramd_.a(localObject2.i()).a;
            if (!bool) {
              if (d1 > d2)
              {
                if (bool) {
                  break label294;
                }
                if (d3 < d4) {
                  break label293;
                }
              }
            }
            if ((bool) || (d1 < d2)) {
              if (bool) {}
            }
            int i = d3 > d4 ? 1 : 0;
            if (i != 0)
            {
              t localt = paramo.v(locale1);
              a.c.w localw3 = localbb.l();
              do
              {
                if (!localw3.e()) {
                  break;
                }
                a.c.e locale3 = localw3.d();
                double d5 = localt.d() + localt.b() - (paramo.m(locale3) - localt.d());
                paramo.a(locale3, d5, paramo.n(locale3));
                localw3.f();
                if (bool) {
                  break label415;
                }
                if (j != 0) {
                  break label413;
                }
              } while (j == 0);
            }
          }
        } while (bool);
        localw1.f();
      } while (j == 0);
      label163:
      label175:
      return;
    }
    
    private void a(o paramo, a.f.c.h paramh, k paramk)
    {
      boolean bool = a.gb;
      int i = a.fb;
      k localk = paramo.c("y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE");
      a.c.w localw1 = a.this.eb.l();
      label230:
      label232:
      label235:
      do
      {
        do
        {
          if (!localw1.e()) {
            return;
          }
          a.c.e locale1 = localw1.d();
          if (bool) {
            break;
          }
          if (paramk.getBool(locale1))
          {
            bb localbb = paramh.c(locale1);
            a.c.w localw2 = localbb.l();
            do
            {
              do
              {
                if (!localw2.e()) {
                  break label235;
                }
                a.c.e locale2 = localw2.d();
                if (i != 0) {
                  break;
                }
                if (!"FAMILY".equals(localk.get(locale2)))
                {
                  m localm = locale2.m();
                  do
                  {
                    if (!localm.e()) {
                      break;
                    }
                    d locald = localm.a();
                    paramo.b(locald, new a.d.w(0.0D, -paramo.d(locale2).d() / 2.0D));
                    a.this.G.a(locald, cd.a((byte)1, true));
                    localm.f();
                    if (bool) {
                      break label232;
                    }
                    if (i != 0) {
                      break label230;
                    }
                  } while (i == 0);
                }
              } while (bool);
              localw2.f();
            } while (i == 0);
          }
          localw1.f();
        } while (bool);
      } while (i == 0);
    }
    
    public void doLayout(o paramo)
    {
      if (!a.gb)
      {
        if (!a.this.s()) {
          a().doLayout(paramo);
        }
      }
      else if (a.fb == 0) {
        return;
      }
      a.f.c.h localh = new a.f.c.h(paramo);
      x localx = db.a();
      a(localh, paramo, localx);
      a().doLayout(paramo);
      a(paramo, localh, localx, this.h);
      a(paramo, localh, localx);
      paramo.a(i.d, a.this.L);
      a.f.d.e locale = (a.f.d.e)this.h.a();
      locale.e((byte)0);
      this.g.a(true);
      a().doLayout(paramo);
      locale.e((byte)1);
      this.g.a(false);
      paramo.j(a.f.d.e.x);
      localh.e();
    }
  }
  
  class d_
    extends r
  {
    private n g = db.b();
    
    d_(rc paramrc)
    {
      super();
    }
    
    public boolean canLayout(o paramo)
    {
      return true;
    }
    
    public a.d.w a(d paramd)
    {
      return (a.d.w)this.g.get(paramd);
    }
    
    public void doLayout(o paramo)
    {
      boolean bool = a.gb;
      int i = a.fb;
      a().doLayout(paramo);
      label128:
      if (a.this.s())
      {
        a.c.w localw = paramo.v();
        label126:
        do
        {
          do
          {
            if (!localw.e()) {
              return;
            }
            a.c.e locale = localw.d();
            m localm = locale.m();
            do
            {
              if (!localm.e()) {
                break;
              }
              d locald = localm.a();
              this.g.a(locald, paramo.s(locald));
              localm.f();
              if (bool) {
                break label128;
              }
              if (i != 0) {
                break label126;
              }
            } while (i == 0);
          } while (bool);
          localw.f();
        } while (i == 0);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.b.a

 * JD-Core Version:    0.7.0.1

 */